
package com.audi.activiey.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;



@Entity
@Table(name = "tbl_activity_user")
public class ActivityUser implements java.io.Serializable{
    
	private static final long serialVersionUID = 5454155825314635342L;
	
	
    /**
     * joinId       db_column: join_id 
     */ 	
	
	private Long joinId;
    /**
     * activityId       db_column: activity_id 
     */ 	
	
	private Long activityId;
    /**
     * userId       db_column: user_id 
     */ 	
	
	private Long userId;
    /**
     * nickName       db_column: nick_name 
     */ 	
	//@Length(max=64)
	private java.lang.String nickName;
    /**
     * 1.审核通过 0 审核未通过       db_column: status 
     */ 	
	
	private Long status;
    /**
     * createTime       db_column: create_time 
     */ 	
	
	private java.util.Date createTime;
	//columns END


	public ActivityUser(){
	}

	public ActivityUser(
		Long joinId
	){
		this.joinId = joinId;
	}

	

	public void setJoinId(Long value) {
		this.joinId = value;
	}
	
	@Id 
	//@SequenceGenerator(name="activity_user_SEQ",sequenceName="seq_activity_user")
    //@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="activity_user_SEQ") 
	@GenericGenerator(name="custom-id", strategy = "identity")
    @GeneratedValue(generator="custom-id")
	@Column(name = "join_id")
	public Long getJoinId() {
		return this.joinId;
	}
	
	@Column(name = "activity_id")
	public Long getActivityId() {
		return this.activityId;
	}
	
	public void setActivityId(Long value) {
		this.activityId = value;
	}
	
	@Column(name = "user_id")
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long value) {
		this.userId = value;
	}
	
	@Column(name = "nick_name",length=64)
	public java.lang.String getNickName() {
		return this.nickName;
	}
	
	public void setNickName(java.lang.String value) {
		this.nickName = value;
	}
	
	@Column(name = "status")
	public Long getStatus() {
		return this.status;
	}
	
	public void setStatus(Long value) {
		this.status = value;
	}

	
	@Column(name = "create_time")
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	/*
	private ActivityInfo activityInfo;
	public void setActivityInfo(ActivityInfo activityInfo){
		this.activityInfo = activityInfo;
	}*/
	
	/*@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "activity_id",nullable = false, insertable = false, updatable = false) 
	})
	public ActivityInfo getActivityInfo() {
		return activityInfo;
	}*/

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("JoinId",getJoinId())
			.append("ActivityId",getActivityId())
			.append("UserId",getUserId())
			.append("NickName",getNickName())
			.append("Status",getStatus())
			.append("CreateTime",getCreateTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getJoinId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof ActivityUser == false) return false;
		if(this == obj) return true;
		ActivityUser other = (ActivityUser)obj;
		return new EqualsBuilder()
			.append(getJoinId(),other.getJoinId())
			.isEquals();
	}
}

